package com.ruoyi.gis.earthai.service;

import com.aliyun.aiearth_engine20220609.Client;
import com.aliyun.teaopenapi.models.Config;
import com.ruoyi.framework.config.AliyunConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EarthAiService {
    @Autowired
    private AliyunConfig aliyunConfig;
    public Client getClient() throws Exception {
        Config config = new Config();
        // 您的AccessKey ID
        config.setAccessKeyId(aliyunConfig.getAccessKey());
        // 您的AccessKey Secret
        config.setAccessKeySecret(aliyunConfig.getAccessSecret());
        config.setRegionId(aliyunConfig.getRegionId());
        config.setEndpoint(aliyunConfig.getEndpoint());
        Client client = new Client(config);
        return client;
    }
}
